<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="../../../vue.js"></script>
    <title>Document</title>
    <style>
      .box {
        width: 200px;
        height: 200px;
      }
      .border {
        border: 5px double green;
      }

      .red {
        background-color: red;
      }
      .blue {
        background-color: blue;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <!-- 字符串形式 -->
      <div class="box" :class="isred?'red':'blue'">cccc</div>
      <!-- 对象形式 -->
      <div class="box" :class="{border:true,blue:true,red:false}"></div>
      <!-- 数组形式 -->
      <div class="box" :class="['border','red']"></div>
    </div>
    <script>
      const vm = new Vue({
        el: '#app',
        data() {
          return {
            isred: true,
          };
        },
      });
    </script>
  </body>
</html>
